#从控制台中分贝获取两个数值，将两数最大值赋给第三个变量
# a = int(input('请输入数值'))
# b = int(input('请输入数值'))
# if a==b:
#     c = a = b
#     print(c)
# elif a < b:
#     c = b
#     print(c)
# else:
#     c = a
#     print(c)
#函数赋值
# c = max(a,b)
# print(c)

#三元表达式
# c = a if a > b else b

#定义一个列表，元素是 1-50之间的数值
# list = list(range(1,5001))
# print(list)
#l = []
#for i in range(1,51):
#    l.append(i)

#列表推导式
#l = [i for i in range(1,51)]
#print(i)
# l = []
# for i in range(2,51,2):
#     l.append(i+3)
# l=[]
# for i in range (1,51):
#     if i%2 ==0:
#         l.append(i+3)
#     else:
#         l.append(i*2)
# print(l)
# l = [i+3 if i%2 == 0 else i*2 for i in range(1,51)]
# print(l)

#乘法口诀
# for i in range(1,10):
#     print()
#     for j in range(1,i+1):
#         print(f"{j}*{i}={j*i}",end=' ')

#冒泡排序
# l=[24,1,76,55,7]
# for i in range(1,len(l)):
#     for j in range(0,len(l)-1):
#         if l[j]>l[j+1]:

# i = 1
# while i<=3:
#     print(f"are you ok?")
#     i+=1

# l=[24,1,76,55,7]
# i=0
# while i<len(l):
#     print(l[i])
#     i+=1


#乘法口诀
# i = 1
# while i < 10:
#     j = 1
#     while j <= i:
#         print(f"{j}*{i}={j*i}",end=' ')
#         j += 1
#     print()
#     i += 1

# l = [3,34,241,12,12,14,22,421]
# i = 0
# while i <len(l):
#     print(f'found {i+1}次')
#     if l[i] == 0:
#         print('got it')
#
#         break
#     i += 1
# else:
#     print('不存在该数值')

# l = [3,34,241,12,12,14,22,421]
# i = 0
# j=0
# while i<len(l):
#     if l[i]==12:
#         j+=1
#     i+=1
# print(j)

# l=[1,2,3,4,56,7,8,9]
# i=0
# sum=0
# while i<len(l):
#     print((f'found{i+1}'))
#
#     if l[i]!=56:
#         print("不统计本次")
#         i+=1
#         continue
#
#     sum+=1
#     print("结束")
#     i+=1
# print(sum)

def find_num_haneVTWO(num,l):
    l = [10,29,30,21,42,54,31]
    i = 0
    while i<len(l):
        print(f"寻找{i+1}次")
        if l[i]==num:
            print("找到了")
            break
        i+=1
        if i==len(l):
            print('not found')

if __name__=='__main__':#调用函数,函数名
    #find_num
    # find_num_haneV(10)
    find_num_haneVTWO(10,ll)
    print("--------------------------")
    print(__name__)









